package behavioral.observer;

public class Client {
	public static void main(String[] args) {
		final ConcreteSubject subject = new ConcreteSubject();
		final Observer observer = new ConcreteObserver();
		subject.attach(observer);
		subject.change("new state");
		subject.detach(observer);

		while (true) {
			System.out.println("1");
			System.out.println("2");
			System.out.println("3");
			System.out.println("4");
			System.out.println("5");
			try {
				Thread.sleep(1000);
			} catch (final InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
